home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
tuthex.arj
/
TUTHEX2.TXT
< prev
next >
Wrap
Text File
|
1992-05-11
|
3KB
|
59 lines
TUTORIAL "HEXING 101" PART 2
What is DEBUG.COM? Well, it is a file located with all of
your DOS files (it comes with DOS). Look for it in the
subdirectory where all your DOS files are kept, then copy it
into your SWOTL\AC subdirectory. Debug allows you alter the
interior contents of a file (among other things). To use it,
we are mainly concerned about 3 commands: E (for edit) W
(write the changes to the file) and Q (quit debugging). The
way to use it is at the DOS prompt > type DEBUG (filename),
then press enter. You will then see a "-", which is the
"prompt" for debug. A sample would be:
DEBUG FW190.SPC <ENTER>
E 100 54 41 20 31 35 32 00 00 00 00 <ENTER>
W <ENTER>
Q <ENTER>
Were you to do this, you would change the name of the plane
in the weapons menu to "TA 152" Go ahead and try it, then
let's discuss what happened. The E command tells debug to
edit the file named when you activated debug, ie the
FW190.SPC file. The first 3 numbers is the "address", ie
that is where the edit command begins making the changes, at
that spot. 100 happens to be the very beginning of the file.
(in PCTools, this is equal to the location that has (0000) as
the identifier) The next 10 pairs of numbers are "bytes", ie
each pair = 1 byte. A byte can have any value from 00 to FF
(hexidecimal to be explained soon). In hex, the value 54 =
to the letter T (in ASCII) and the value of 41 = A, so that's
where the TA comes from. The main program knows to use the
letters instead of the strict numerical value here. The 20 =
a "blank space" in ASCII, and 30 - 39 are equal to the
numbers 0 through 9 in hex. So what we did was told the
debug to make the change to the SPC file, TA "blank" 152 "no
value" "no value" "no value" "no value". Why the 4 "no
values?" To blank over the original name, which is FW 190 A-
8, which is ten bytes long.
You need to get a chart that lists all the hexidecimal to
ASCII equivalents, ie 41 = A, 61 = a, etc. This will help.
THINKING IN HEXIDECIMAL. We use base 10 as our number
system. Computers use base 16, because it is a power of 2.
(because of binary, I think). So just as we have our ones,
tens, and hundreds, hexidecimal has ones, sixteens, and 256s.
The "numbers" in hexidecimal go like this:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F -therefore A=10 B=11 C=12
and F=15. So a byte location with 0C = 12. A byte location
with 0F = 15. The number 25 would be written as 19 in
hexidecimal, 16x1 plus 1x9 = 25. The value of FA in hex is
250 in decimal (16 x F = 240, plus 1 x A = 10; add for 250)
NOW IT GETS A LITTLE TRICKY. The hex values sometimes are
for only one byte, but sometimes two bytes are taken as a
pair for numbers that are above 255 large. For example, 300
rounds of ammo would be 2C 01. 2=32 (16x2) C=12 (1x12) 0=0
(4096x0) 1=256 (256x1). 32+12+256 = 300. It is just like a
decimal number, but the ones, tens, hundreds and thousands
columns are a little jumbled. Here it is again:
2 C 0 1
(sixteens) (ones) (4096s) (256s)
I don't know why this is the order, Tom Philo posted why, but
I've come to accept it (grin). Next lesson: PCTools.